/*
 *  Cero Project - Copyright   2006 The Cero Developement Team 
 *  (Michael Laguerre, Camille Roux, Matthieu Segret, Mathieu Sivade) 
 * 
 *  This program is free software; you can redistribute it and/or modify it 
 *  under the terms of the GNU General Public License as published by the Free 
 *  Software Foundation; either version 2 of the License, or (at your option) 
 *  any later version.
 * 
 *  This program is distributed in the hope that it will be useful, but 
 *  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 
 *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 
 *  for more details.
 */

package org.ceroproject.games;

import java.util.EventListener;

/**
 * A listener to player's actions
 * 
 * @author Telem
 */
public interface ActionListener extends EventListener {
	/**
	 * This method gets called when a player played an Action, though this
	 * action hasn't been validated yet
	 * 
	 * @param action
	 *            the action which got played
	 */
	void onPlayerPlayed(Action action);

	/**
	 * This method gets called when the action got executed
	 * 
	 * @param action
	 *            the action which got executed
	 */
	void onExecuted(Action action);

	/**
	 * This method gets called when the action failed
	 * 
	 * @param action
	 *            the action which failed
	 */
	void onFailed(Action action);
	
	/**
	 * Returns the type of action this listener want to listen to.
	 * 
	 * @return the type of action this listener want to listen to. If any action
	 *         is being listened to, returns null.
	 */
	Class listenedAction();
}
